package cn.sc.summer.mybatis.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import cn.sc.summer.constant.project.DateConstant;
import cn.sc.summer.mybatis.annotation.table.TableFieldX;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 类名：实体类公共信息集成对象-更新人员信息
 *
 * @author a-xin
 * @date 2023/8/13 21:29
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public abstract class BaseUserModel extends BaseModel implements Serializable {

    private static final long serialVersionUID = -6867156232825350373L;

    /**
     * 更新人ID
     */
    @TableField(value = "update_user", fill = FieldFill.INSERT_UPDATE)
    @TableFieldX(length = 32, comment = "更新人ID")
    private String updateUser;

    /**
     * 创建人ID
     */
    @TableField(value = "create_user", fill = FieldFill.INSERT)
    @TableFieldX(length = 32, comment = "创建人ID")
    private String createUser;

    /**
     * 更新数据时间
     */
    @DateTimeFormat(pattern = DateConstant.YYYY_MM_DD_HH_MM_SS_1)
    @JsonFormat(timezone = DateConstant.TIME_ZONE, pattern = DateConstant.YYYY_MM_DD_HH_MM_SS_1)
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @TableFieldX(length = 6, comment = "更新数据时间")
    private Date updateTime;

    /**
     * 创建数据时间
     */
    @DateTimeFormat(pattern = DateConstant.YYYY_MM_DD_HH_MM_SS_1)
    @JsonFormat(timezone = DateConstant.TIME_ZONE, pattern = DateConstant.YYYY_MM_DD_HH_MM_SS_1)
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @TableFieldX(length = 6, comment = "创建数据时间")
    private Date createTime;

}
